package designPattern.structuralPattern.adapter.双向适配器模式;

/**
 * @author wei.zhao
 * @description: 双向适配器
 * @date 2021年12月15日 14:13
 */
public class TwoWayAdapter implements Target, Adaptee {

    private Adaptee adaptee;

    private Target target;

    public TwoWayAdapter(Adaptee adaptee) {
        this.adaptee = adaptee;
    }

    public TwoWayAdapter(Target target) {
        this.target = target;
    }

    @Override
    public void request() {
        adaptee.specificRequest();
    }

    @Override
    public void specificRequest() {
        target.request();
    }
}
